<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
</head>
<body>

	<div id="div">
		<p v-html="str"></p>
		<button v-on:click="res(1)">点击反转</button>
		<button @click="res(2)">点击转换大小写</button>
	</div>
	<script src="vue.js"></script>
	<script>
		const vm=new Vue({
			el:'#div',
			data:{
				str:'asdfhgjk'
			},
			methods:{
				res(as){
					if(as ==1){
					    this.str=this.str.split('').reverse().join('');
				    }else{
				    	this.str=this.str.toUpperCase('')
				    }
			    }
			}
		})
	</script>
	
</body>
</html>